﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="HouseCompare2.aspx.cs" Inherits="HouseCompare2" Title="房源对比" %>

<asp:Content ID="Content1" ContentPlaceHolderID="main" Runat="Server">
<link href="css/houseshow.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
<!--
	function _remove(obj){		
	    var curA = obj;
		Chenxin.ajax({
		    type:"get",
		    url:"service/compareHouse.ashx",
		    data: "op=remove&houseId=" + $(obj).parent().find("input[name='houseId']").val(),
	        async : false,
	        onSuccess: function(data,msg) {
	            alert(msg);
	            
	            var idx=$(curA).parent(),curTd=idx[0].nodeName,idxattr='ck';
		        idx.attr(idxattr,true);
		        idx=idx.parent().children(curTd);
		        for(var i=0,l=idx.length;i<l;i++){
			        if(idx.eq(i).attr(idxattr)){
				        idx.eq(i).removeAttr(idxattr);
				        idx=i;
				        break;
			        }
		        }
		        $('#CompareTable tr').each(function(){
			        $(this).children('th,td').eq(idx).hide();

		        });
	        }
		});
	}
//-->
</script>
<script type="text/javascript">

$(document).ready(function(){

	$("#nicemenu img.arrow").click(function(){ 
								
		$("span.head_menu").removeClass('active');
		
		submenu = $(this).parent().parent().find("div.sub_menu");
		
		if(submenu.css('display')=="block"){
			$(this).parent().removeClass("active"); 	
			submenu.hide(); 		
			$(this).attr('src','images/arrow_hover.png');									
		}else{
			$(this).parent().addClass("active"); 	
			submenu.fadeIn(); 		
			$(this).attr('src','images/arrow_select.png');	
		}
		
		$("div.sub_menu:visible").not(submenu).hide();
		$("#nicemenu img.arrow").not(this).attr('src','arrow.png');
						
	})
	.mouseover(function(){ $(this).attr('src','images/arrow_hover.png'); })
	.mouseout(function(){ 
		if($(this).parent().parent().find("div.sub_menu").css('display')!="block"){
			$(this).attr('src','images/arrow.png');
		}else{
			$(this).attr('src','images/arrow_select.png');
		}
	});

	$("#nicemenu span.head_menu").mouseover(function(){ $(this).addClass('over')})
								 .mouseout(function(){ $(this).removeClass('over') });
	
	$("#nicemenu div.sub_menu").mouseover(function(){ $(this).fadeIn(); })
							   .blur(function(){ 
							   		$(this).hide();
									$("span.head_menu").removeClass('active');
								});		
								
	$(document).click(function(event){ 		
			var target = $(event.target);
			if (target.parents("#nicemenu").length == 0) {				
				$("#nicemenu span.head_menu").removeClass('active');
				$("#nicemenu div.sub_menu").hide();
				$("#nicemenu img.arrow").attr('src','images/arrow.png');
			}
	});			   
							   
								   
});

</script>
<div class="listpahlinks">
        <span>
            <a href="#">系统首页</a>
        </span>
        <span> > </span>
        <span><a href="#">房源对比</a></span>
    </div>
<div id="mainbody">
<div style=" width:905px; margin:5px auto; overflow:auto;overflow-y:hidden;">
 <table id="CompareTable" cellspacing="0" cellpadding="0">
    <tbody>
      <tr class=" toolbar">
        <th scope="col"></th>
        <% 
            if (houseInfoList != null && houseInfoList.Count > 0) {
                for (int i = 0; i < houseInfoList.Count; i++) {
        %>
        <th><a href="#" onclick="_remove(this)">移除</a>
        <input type="hidden" name="houseId" value="<%=  houseInfoList[i].HouseId%>" />
        </th>            
        <%            
                    
                } 
            }    
        %>

      </tr>
    <tr class="graybg">
      <th scope="row"><span style="width:90px; display:block;">房源地址：</span></th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><span style="width:150px; display:block;">
            <a  href="ShowDetailInfo.aspx?houseid=<%= houseBaseInfo.HouseId %> " target="blank"><%= houseBaseInfo.Community + houseBaseInfo.BuildingName + houseBaseInfo.Room%></a></span></td>
      <%                         
               } 
           }    
      %>
    </tr>
    <tr>
      <th scope="row">房源编号：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%=  houseBaseInfo.HouseCode%></td>
      <%                         
               } 
           }    
      %>
    </tr>
     <tr>
      <th scope="row">小区地址：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%=  houseBaseInfo.Address%></td>
      <%                         
               } 
           }    
      %>
    </tr>
    <tr>
      <th scope="row">售价：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%= (houseBaseInfo.SalePrice_T == 0 || houseBaseInfo.SalePrice_T == null) ? "--" : Convert.ToString(Math.Round((decimal)houseBaseInfo.SalePrice_T / 10000, 2)) + "万"%></td>
      <%                         
               } 
           }    
      %>
    </tr>
    <tr>
      <th scope="row">租价：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%= (houseBaseInfo.RentPrice == 0 || houseBaseInfo.RentPrice == null) ? "--" : Convert.ToString(houseBaseInfo.RentPrice) + "元/月"%></td>
      <%                         
               } 
           }    
      %>
    </tr>    
     <tr>
      <th scope="row">区域：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%= houseBaseInfo.Region%></td>
      <%                         
               } 
           }    
      %>    
    </tr>
     <tr>
      <th scope="row">版块：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%= houseBaseInfo.Block %></td>
      <%                         
               } 
           }    
      %>    
    </tr>
     <tr>
      <th scope="row">房型：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%= ((houseBaseInfo.Model_Room == null || houseBaseInfo.Model_Room == 0) ? "--" : Convert.ToString(houseBaseInfo.Model_Room) + "室") + ((houseBaseInfo.Model_Hall == null || houseBaseInfo.Model_Hall == 0) ? "--" : Convert.ToString(houseBaseInfo.Model_Hall) + "厅") + ((houseBaseInfo.Model_Toilet == null || houseBaseInfo.Model_Toilet == 0) ? "--" : Convert.ToString(houseBaseInfo.Model_Toilet) + "卫") + ((houseBaseInfo.Model_Balcony == null || houseBaseInfo.Model_Balcony == 0) ? "--" : Convert.ToString(houseBaseInfo.Model_Balcony) + "阳台")%></td>
      <%                         
               } 
           }    
      %>      
    </tr>
     <tr>
      <th scope="row">面积：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%= (houseBaseInfo.BuildingArea == null || houseBaseInfo.BuildingArea == 0) ? "--" : Convert.ToString(houseBaseInfo.BuildingArea) + "㎡"%></td>
      <%                         
               } 
           }    
      %>      
    </tr>
      <tr>
      <th scope="row">用途：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%= houseBaseInfo.HouseUse%></td>
      <%                         
               } 
           }    
      %>      
    </tr>
      <tr>
      <th scope="row">交易：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><% if (houseBaseInfo.BusinessKind == 20){%>出租<%}else if (houseBaseInfo.BusinessKind == 10){%>出售<%}else { %>租售<%}%></td>
      <%                         
               } 
           }    
      %>      
    </tr>
      <tr>
      <th scope="row">状态：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><% if(houseBaseInfo.Status==10){%>有效<%}else if (houseBaseInfo.Status == -10){%>无效<%}else{%>暂缓<%}%></td>
      <%                         
               } 
           }    
      %>      
    </tr>
      <tr>
      <th scope="row">来源：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%=houseBaseInfo.InfoSource%></td>
      <%                         
               } 
           }    
      %>      
    </tr>
    <tr>
      <th scope="row">楼层：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%= ((houseBaseInfo.Cur_Floor == null || houseBaseInfo.Cur_Floor == 0) ? "--" : Convert.ToString(houseBaseInfo.Cur_Floor)) + "/" + ((houseBaseInfo.Total_Floor == null || houseBaseInfo.Total_Floor == 0) ? "--" : Convert.ToString(houseBaseInfo.Total_Floor))%></td>
      <%                         
               } 
           }    
      %>      
    </tr>
    <tr>
      <th scope="row">朝向：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%=houseBaseInfo.Direction%></td>
      <%                         
               } 
           }    
      %>      
    </tr>
    <tr>
      <th scope="row">建筑年代：</th>
      <% 
          if (houseInfoList != null && houseInfoList.Count > 0) {
              for (int i = 0; i < houseInfoList.Count; i++) {
                  Chenxin.Lib.House.Entity.House_BaseInfo houseBaseInfo = houseInfoList[i];
      %>
      <td class="picname"><%=houseBaseInfo.CompleteYear%>年</td>
      <%                         
               } 
           }    
      %>      
    </tr>
    </tbody>
  </table>
</div>
</div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="foot" Runat="Server">
</asp:Content>

